package org.wang.generalcode.modules.exam.constants;

public class EnumConstants {

    public enum CorrectType {
        SYSTEM(1, "系统判分"), TEACHER(2, "教师判分"), SYSTEM_AND_TEACHER(3, "系统加教师判分");
        private Integer value;
        private String name;

        CorrectType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum QuestionType {
        SINGLE_QUESTION(90, "单选题"), MULTIPLE_QUESTION(91, "多选题"),
        FILL_QUESTION(92, "填空题"), SYNTHESIS_QUESTION(93, "综合题"),
        INDEFINITE_ITEM_QUESTION(94, "不定项题"),
        CALCULATION_QUESTION(96, "计算题"),
        JUDGMENT_QUESTION(95, "判断题");
        private Integer value;
        private String name;
        QuestionType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public static String getName(Integer type) {
            QuestionType questionTypes[] = values();
            for (QuestionType questionType : questionTypes) {
                if (questionType.getValue() == type) {
                    return questionType.getName();
                }
            }
            return null;
        }
    }
}
